/*
 * @Author: zhangzhen
 * @Date: 2023-01-03 09:00:50
 * @LastEditors: zhangzhen
 * @LastEditTime: 2023-01-09 13:24:55
 *
 */
import React, {FC} from 'react';
import {Select, Form} from 'antd';
import {FormConTextValueType} from '../context';

const FormItem = Form.Item;

const SelectComponent: FC<FormConTextValueType> = (props) => {
    const {
        label,
        name,
        rules,
        required,
        infoCome,
        isSearch,
        defaultValue,
        isShowInTable,
        labelSpan,
        ...selectProps
    } = props;

    return (
        <FormItem
            label={label}
            labelCol={{flex: `${labelSpan}px`}}
            name={name}
            rules={rules}
            required={required}
            initialValue={defaultValue}>
            <Select {...selectProps} />
        </FormItem>
    );
};

export default SelectComponent;
